Skip to content

Added Skill Check Dialog Using New Centralized Skill Check Utility #6578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 11, 2025

Conversation

IllianiBird
Copy link
Collaborator

Dev Notes

As mentioned in the title, this PR adds the ability for players to trigger Skill Checks at will. This is done by right-clicking on the character (or characters) and selecting 'Perform Skill Check', at which point the player is presented with a dialog where they can choose the skill and modifiers. They can also choose whether to use Edge, in the event of a failure.

image

Once the check has been set up the player is then presented with a second dialog showing the results of the check.

image

This functionality all uses our new centralized Skill Check utility class, ensuring that SPAs, traits, and attribute scores are all correctly factored into the target number.

Placeholder Art

This PR uses placeholder AI Generated art assets. A human artist has already been commissioned and expects to have the pieces ready by the launch of 50.05. Three pieces have been commissioned, the first is for the page where the user selects skill. Then there are two follow-up pieces one for when the check passes, another for when the check fails.

Ulterior Motives

Really I just wanted to test the new centralized Skill Check class and fix any bugs. That we get a fancy new dialog out of it is just a cherry on top of an unintentional cake.

- Implemented new skill check feature, including UI updates and backend logic.
- Refactored `SkillType`, `SkillCheckUtility` `MarginOfSuccess` enums to remove a handful of bugs or to add new functionality.
… failure images based on skill check results.
@IllianiBird IllianiBird added Personnel Personnel-related Issues GUI UX User experience labels Apr 7, 2025
@IllianiBird IllianiBird self-assigned this Apr 7, 2025
@IllianiBird IllianiBird added Bug Severity: Medium Issues described as medium severity as per the new issue form labels Apr 7, 2025
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 0.76336% with 130 lines in your changes missing coverage. Please review.

Project coverage is 11.42%. Comparing base (2fef8ef) to head (04b447a).
Report is 33 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/gui/dialog/SkillCheckDialog.java 0.00% 70 Missing ⚠️
...q/campaign/personnel/skills/SkillCheckUtility.java 4.54% 21 Missing ⚠️
...mponents/immersiveDialogs/ImmersiveDialogCore.java 0.00% 18 Missing ⚠️
...mpaign/personnel/skills/enums/MarginOfSuccess.java 0.00% 12 Missing ⚠️
.../mekhq/gui/adapter/PersonnelTableMouseAdapter.java 0.00% 8 Missing ⚠️
MekHQ/src/mekhq/gui/view/PersonViewPanel.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6578      +/-   ##
============================================
- Coverage     11.43%   11.42%   -0.01%     
- Complexity     6451     6456       +5     
============================================
  Files          1086     1087       +1     
  Lines        139459   139560     +101     
  Branches      21571    21584      +13     
============================================
+ Hits          15948    15950       +2     
- Misses       121914   122015     +101     
+ Partials       1597     1595       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +1 to +7
package mekhq.gui.dialog;

import static megamek.common.Compute.randomInt;
import static mekhq.campaign.personnel.skills.SkillCheckUtility.determineTargetNumber;
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;

import java.awt.GridBagConstraints;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright header.

@IllianiBird IllianiBird merged commit 974f73a into MegaMek:master Apr 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Personnel Personnel-related Issues Severity: Medium Issues described as medium severity as per the new issue form UX User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants